Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TRA-81] Check isolated market constraints in UpdateSubaccount. #1158

Merged
merged 14 commits into from
Mar 13, 2024

Conversation

vincentwschau
Copy link
Contributor

Changelist

Adds logic to check whether updates passed into UpdateSubaccount are valid under the isolated markets constraints.

Test Plan

Unit tests.

Author/Reviewer Checklist

  • If this PR has changes that result in a different app state given the same prior state and transaction list, manually add the state-breaking label.
  • If the PR has breaking postgres changes to the indexer add the indexer-postgres-breaking label.
  • If this PR isn't state-breaking but has changes that modify behavior in PrepareProposal or ProcessProposal, manually add the label proposal-breaking.
  • If this PR is one of many that implement a specific feature, manually label them all feature:[feature-name].
  • If you wish to for mergify-bot to automatically create a PR to backport your change to a release branch, manually add the label backport/[branch-name].
  • Manually add any of the following labels: refactor, chore, bug.

Copy link

linear bot commented Mar 8, 2024

Copy link
Contributor

coderabbitai bot commented Mar 8, 2024

Walkthrough

The updates introduce a new market pair ISO2-USD, including its configuration and tests. They also refine the handling of market prices, especially for this new pair, by updating test utilities, daemon configurations, and keeper tests. Additionally, enhancements are made to subaccount management, focusing on isolated perpetual constraints to ensure compliance during updates. This comprehensive change set aims to expand market options and improve the system's robustness in managing subaccounts and market price updates.

Changes

File(s) Change Summary
protocol/testutil/constants/prices.go
protocol/testutil/daemons/pricefeed/exchange_config/market_id.go
Introduced ISO2-USD market pair, including its configuration, exponent, and test market details. Renamed MARKET_ISO_USD to MARKET_ISO2_USD and reintroduced MARKET_ISO_USD.
protocol/x/prices/keeper/... (All test files under this path) Updated tests to include the new ISO2-USD market pair and its price updates. Adjusted to accommodate changes in market IDs and price updates, including error handling and price validation.
protocol/daemons/liquidation/client/grpc_helper_test.go Modified to include an additional market price for testing.
protocol/x/subaccounts/keeper/isolated_subaccount.go
protocol/x/subaccounts/keeper/subaccount.go
protocol/x/subaccounts/keeper/subaccount_test.go
Added functionality and tests for validating updates to subaccounts against isolated perpetual constraints, ensuring adherence to rules for isolated perpetuals.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 909c47f and 151a5d7.
Files selected for processing (10)
  • protocol/testutil/constants/perpetuals.go (1 hunks)
  • protocol/testutil/constants/pricefeed.go (1 hunks)
  • protocol/testutil/constants/prices.go (6 hunks)
  • protocol/testutil/daemons/pricefeed/exchange_config/market_id.go (1 hunks)
  • protocol/x/subaccounts/keeper/isolated_subaccount.go (1 hunks)
  • protocol/x/subaccounts/keeper/subaccount.go (1 hunks)
  • protocol/x/subaccounts/keeper/subaccount_test.go (1 hunks)
  • protocol/x/subaccounts/types/errors.go (1 hunks)
  • protocol/x/subaccounts/types/update.go (2 hunks)
  • protocol/x/subaccounts/types/update_test.go (1 hunks)
Files not reviewed due to errors (1)
  • (no review received)
Files skipped from review due to trivial changes (1)
  • protocol/testutil/constants/pricefeed.go
Additional comments: 8
protocol/x/subaccounts/types/errors.go (1)
  • 43-46: The addition of ErrFailedToUpdateIsolatedSubaccount and ErrMixedIsolatedCrossUpdatesNotSupported error variables with codes 600 and 601 respectively, is correctly implemented. These errors are well-defined and follow the existing pattern for error handling within the module.
protocol/x/subaccounts/types/update.go (1)
  • 60-60: The addition of ViolatesIsolatedSubaccountConstraints to updateResultStringMap and its declaration in the const block is correctly implemented. This update result is well-defined and follows the existing pattern for handling update results within the module.
protocol/testutil/daemons/pricefeed/exchange_config/market_id.go (1)
  • 78-80: The renaming of MARKET_ISO_USD to MARKET_ISO2_USD and the addition of a new MARKET_ISO_USD constant are correctly implemented. These changes ensure that both isolated markets are represented and follow the existing pattern for defining market identifiers.
protocol/x/subaccounts/types/update_test.go (1)
  • 91-96: The updates to the TestUpdateResultString function, including the new test case for ViolatesIsolatedSubaccountConstraints and the modification to the UnexpectedError test case, are correctly implemented. These changes ensure comprehensive testing of update results and follow the existing pattern for test case handling.
protocol/x/subaccounts/keeper/isolated_subaccount.go (1)
  • 11-143: The logic introduced for validating updates against isolated market constraints, including the checkIsolatedSubaccountConstraints and isValidIsolatedPerpetualUpdates functions, is correctly implemented. These functions are well-defined, follow best practices for error handling and validation, and ensure that updates comply with isolated market constraints in a clear and maintainable manner.
protocol/testutil/constants/prices.go (1)
  • 289-307: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [30-318]

The addition of the Iso2UsdPair and Iso2UsdExponent constants, along with updates to test configurations and data to include the new isolated market, are correctly implemented. These changes ensure comprehensive testing of the new isolated market and follow the existing pattern for defining market pairs and test configurations.

protocol/testutil/constants/perpetuals.go (1)
  • 330-341: The addition of the Iso2Usd_IsolatedMarket constant is correctly implemented and aligns with the PR's objectives to support a new isolated market. The parameters chosen for this market, including its MarketType as PERPETUAL_MARKET_TYPE_ISOLATED, are appropriate and consistent with the protocol's design for isolated markets.
protocol/x/subaccounts/keeper/subaccount.go (1)
  • 295-300: The addition of checkIsolatedSubaccountConstraints within UpdateSubaccounts introduces a crucial validation step for ensuring updates to subaccounts comply with isolated market constraints. This is a significant enhancement aligning with the PR's objectives to enforce isolated market rules rigorously. However, it's essential to ensure that the implementation of checkIsolatedSubaccountConstraints is robust, efficiently handles edge cases, and is well-documented to facilitate future maintenance and understanding of the logic involved.

Ensure comprehensive testing of this function, especially focusing on edge cases and scenarios where isolated market constraints could be violated.

protocol/x/subaccounts/keeper/subaccount.go Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 151a5d7 and 9d996f9.
Files selected for processing (1)
  • protocol/testutil/constants/pricefeed.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • protocol/testutil/constants/pricefeed.go

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 9d996f9 and 8123415.
Files selected for processing (5)
  • protocol/testutil/constants/prices.go (6 hunks)
  • protocol/x/prices/keeper/msg_server_update_market_prices_test.go (11 hunks)
  • protocol/x/prices/keeper/smoothed_price_test.go (3 hunks)
  • protocol/x/prices/keeper/update_price_test.go (3 hunks)
  • protocol/x/prices/keeper/validate_market_price_updates_test.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • protocol/testutil/constants/prices.go
Additional comments: 13
protocol/x/prices/keeper/smoothed_price_test.go (3)
  • 62-62: The addition of constants.MarketId4 to the expectedResult map in the test case "Mixed updates and additions - mix of present and missing index prices, smoothed prices" correctly reflects the inclusion of a new market ID for testing. This change ensures that the test coverage is extended to include the newly supported market, aligning with the PR objectives to enhance isolated market constraint handling.
  • 85-86: The inclusion of constants.MarketId4 in the expectedErr string for the test case "Interpolation errors - returns error" is appropriate. It ensures that the error messages are accurately tested for the new market ID, maintaining the integrity of error handling in scenarios where interpolation fails. This change is crucial for validating the robustness of the error handling mechanism for isolated markets.
  • 100-100: Adding constants.MarketId4 to the expectedResult map in the test case "Single interpolation error - returns error, continues updating other markets" is a necessary update to test the behavior of the system when interpolation errors occur for specific markets. It demonstrates the system's ability to continue updating other markets despite encountering errors, which is vital for ensuring system resilience.
protocol/x/prices/keeper/update_price_test.go (3)
  • 204-204: The addition of MarketId4 with Price3 in the expectedMsg for the test case "Multiple market price updates, some from smoothed price and some from index price" is a significant update. It ensures that the new market ID is considered in the validation of market price updates, which is essential for testing the system's ability to handle updates across multiple markets, including isolated ones.
  • 236-236: Including MarketId4 in the expectedMsg for the test case "Mix of valid and invalid index prices" correctly extends the test coverage to include the new market ID. This change is crucial for ensuring that the system accurately processes a mix of valid and invalid market price updates, reflecting the PR's objective to enhance isolated market constraint handling.
  • 255-255: The addition of MarketId4 in the expectedMsg for the test case "Mix of valid, invalid, and invalid historical smoothed prices" is appropriate. It ensures that the system's ability to handle a variety of market price update scenarios, including those involving new market IDs, is thoroughly tested. This change aligns with the PR's goal of improving the protocol's support for isolated markets.
protocol/x/prices/keeper/msg_server_update_market_prices_test.go (4)
  • 51-51: The inclusion of constants.MarketId4 in the expectedMarketToPriceInState map for the test case "Empty updates" in the TestUpdateMarketPrices_Valid function is a necessary update. It ensures that the test coverage includes the new market ID, which is crucial for verifying that the system correctly maintains the state of market prices, including those for newly supported markets.
  • 62-62: Adding constants.MarketId4 with its corresponding price value in the expectedMarketToPriceInState map for the test case "Multiple updates" in the TestUpdateMarketPrices_Valid function correctly extends the test coverage to include the new market ID. This change is essential for testing the system's ability to handle multiple market price updates accurately, including those involving isolated markets.
  • 86-86: The inclusion of constants.MarketId4 in the expectedMarketToPriceInState map for various test cases within the TestUpdateMarketPrices_Valid function, such as "Towards index price = true (current < update < index price)", is appropriate. It ensures comprehensive test coverage, including scenarios where market prices are updated towards the index price.
  • 236-236: Including constants.MarketId4 in the expectedMarketToPriceInState map for the test case "Index price does not exist, but still updates state" in the TestUpdateMarketPrices_SkipNonDeterministicCheck_Valid function is a crucial update. It ensures that the test coverage includes scenarios where index prices do not exist for new market IDs, which is vital for testing the system's robustness in handling non-deterministic checks.
protocol/x/prices/keeper/validate_market_price_updates_test.go (3)
  • 377-377: The addition of constants.MarketId4 to the expectedMarketIds slice in the test case "Empty proposed updates, Non-empty local updates" correctly reflects the update to include a new market ID, ensuring the test aligns with the updated market configurations.
  • 395-395: The inclusion of constants.MarketId4 in the msgUpdateMarketPrices slice for the test case "Non-empty proposed updates, Non-empty local updates, single missing market" is appropriate. It ensures that the test case accurately represents the scenario where all but one market ID is present in the proposed updates, thereby testing the functionality of identifying missing market IDs effectively.
  • 408-408: Adding constants.MarketId4 to the expectedMarketIds slice in the test case "Non-empty proposed updates, Non-empty local updates, multiple missing markets, sorted" is correct. This change ensures that the test case accurately reflects the updated market configurations and tests the functionality of identifying multiple missing market IDs in a sorted manner.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 8123415 and 603f470.
Files selected for processing (1)
  • protocol/daemons/liquidation/client/grpc_helper_test.go (1 hunks)
Additional comments: 1
protocol/daemons/liquidation/client/grpc_helper_test.go (1)
  • 414-414: The addition of constants.TestMarketPrices[4] to the MarketPrices slice in the TestGetAllMarketPrices function is a positive change, as it likely extends the test coverage to include more market scenarios. However, it's crucial to ensure that this addition aligns with the specific objectives of testing isolated market constraints. Consider verifying the following:
  • The relevance of the added market price to isolated market scenarios.
  • The comprehensive coverage of isolated market constraints in the test suite.

@vincentwschau vincentwschau changed the title [TRA-68] Check isolated market constraints in UpdateSubaccount. [TRA-81] Check isolated market constraints in UpdateSubaccount. Mar 9, 2024
Copy link

linear bot commented Mar 9, 2024

@@ -292,6 +292,13 @@ func (k Keeper) UpdateSubaccounts(
perpIdToFundingIndex[perp.Params.Id] = perp.FundingIndex
}

// Check if the updates satisfy the isolated perpetual constraints.
success, successPerUpdate, err = k.checkIsolatedSubaccountConstraints(
Copy link
Contributor

@teddyding teddyding Mar 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we put this in internalCanUpdateSubaccounts? IIRC, we try to maintain the constraint that CanUpdateSubaccount success guarantees UpdateSubaccounts success on the same input updates. This will no longer hold true if the input updates fails checkIsolatedSubaccountConstraints, which is only checked in UpdateSubaccounts

Either way, should probably put this check before the collateralization check logic in internalCanUpdateSubaccounts to short-circuit those expensive checks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to this comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CanUpdateSubaccounts has a different constraint from UpdateSubaccounts which is why I decided to pull this function into UpdateSubaccounts and not CanUpdateSubaccounts.
CanUpdateSubaccounts does not require unique subaccounts in updates, but UpdateSubaccounts does.
There may not be a use of this specific behavior of CanUpdateSubaccounts, I can check, however I preferred changing UpdateSubaccounts rather than CanUpdateSubaccounts after seeing this difference between the 2 functions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CanUpdateSubaccounts is called in AddOrderToOrderbookCollatCheck
Would this mean that an order violating constraints can potentially be go on the orderbook?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's true that it can be added to the orderbook since AddOrderToOrderbookCollatCheck calls CanUpdateSubaccounts. However this is also a path where having a set of updates with non-unique subaccounts are run through CanUpdateSubaccounts but never through UpdateSubaccounts and just adding the above check to CanUpdateSubaccounts would break a working flow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the unique subaccount check in checkIsolatedSubaccountConstraints and moved into internalCanUpdateSubaccounts. Specified in comments that the function does not consider constraints across multiple updates.

"github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types"
)

// checkIsolatedSubaccountConstaints will validate all `updates` to the relevant subaccounts against
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my understanding, do we ever expect these constraints to fail during normal operations? If isolated subaccounts is abstracted away from the user, then upstream x/clob logic would be responsible for populating the updates correctly right? So this is more of an internal sanity check?

Copy link
Contributor Author

@vincentwschau vincentwschau Mar 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream x/clob logic relies on UpdateSubaccounts to determine if the updates to a subaccount for a match are valid. This isn't an internal sanity check, this would be the function / logic that would ensure orders which result in a match that would lead to an invalid subaccount state (based on these new constraints from isolated markets) result in an error.
So during "normal" operations, it is possible for a user with an isolated subaccount to place an order for a different perpetual. Only when a match occurs, would the update fail and the order fail.
There is additional non-scoped work to add logic to x/clob to prevent users from even sending orders that would lead to matches that are invalid based on the isolated market constraints.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 603f470 and d51033f.
Files selected for processing (1)
  • protocol/x/subaccounts/keeper/isolated_subaccount.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • protocol/x/subaccounts/keeper/isolated_subaccount.go

Copy link
Contributor

@shrenujb shrenujb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for the most part!

Can we also add an integration test for placing an orders for isolated markets if no other core changes are required?

protocol/x/subaccounts/keeper/isolated_subaccount.go Outdated Show resolved Hide resolved
@@ -292,6 +292,13 @@ func (k Keeper) UpdateSubaccounts(
perpIdToFundingIndex[perp.Params.Id] = perp.FundingIndex
}

// Check if the updates satisfy the isolated perpetual constraints.
success, successPerUpdate, err = k.checkIsolatedSubaccountConstraints(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CanUpdateSubaccounts is called in AddOrderToOrderbookCollatCheck
Would this mean that an order violating constraints can potentially be go on the orderbook?


// There cannot be more than a single perpetual update if an update to an isolated perpetual
// exists in the slice of perpetual updates.
if hasIsolatedUpdate && len(settledUpdate.PerpetualUpdates) > 1 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible we have multiple perpetual update entries with the same isolated perpetual?

StillUndercollateralized: "StillUndercollateralized",
WithdrawalsAndTransfersBlocked: "WithdrawalsAndTransfersBlocked",
UpdateCausedError: "UpdateCausedError",
ViolatesIsolatedSubaccountConstraints: "ViolatesIsolatedSubaccountConstraints",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this how the error gets propagated to the client? Do we think we need to provide more info or would this be sufficient?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's several more layers of indirection before this error is sent to the client. I'm planning on looking at the error propagation once integration tests / more E2E testing is added.

@vincentwschau
Copy link
Contributor Author

Can we also add an integration test for placing an orders for isolated markets if no other core changes are required?

Agree on adding more integration / E2E testing. Will add a TODO for this, however I don't want to include and increase scope of this PR.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between d51033f and f4a7413.
Files selected for processing (3)
  • protocol/x/subaccounts/keeper/isolated_subaccount.go (1 hunks)
  • protocol/x/subaccounts/keeper/subaccount.go (2 hunks)
  • protocol/x/subaccounts/keeper/subaccount_test.go (2 hunks)
Files skipped from review as they are similar to previous changes (3)
  • protocol/x/subaccounts/keeper/isolated_subaccount.go
  • protocol/x/subaccounts/keeper/subaccount.go
  • protocol/x/subaccounts/keeper/subaccount_test.go

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between f4a7413 and 733c4c3.
Files selected for processing (2)
  • protocol/x/subaccounts/keeper/isolated_subaccount.go (1 hunks)
  • protocol/x/subaccounts/keeper/subaccount.go (5 hunks)
Files skipped from review as they are similar to previous changes (2)
  • protocol/x/subaccounts/keeper/isolated_subaccount.go
  • protocol/x/subaccounts/keeper/subaccount.go

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 733c4c3 and ea0985b.
Files selected for processing (1)
  • protocol/x/subaccounts/keeper/subaccount.go (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • protocol/x/subaccounts/keeper/subaccount.go

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between ea0985b and 124bc3f.
Files selected for processing (1)
  • protocol/app/e2e/ante_test.go (1 hunks)
Check Runs (5)
install-runsim completed (5)
validate-yaml completed (1)
build completed (1)
exchange-tests completed (1)
labeler completed (1)
Additional comments: 1
protocol/app/e2e/ante_test.go (1)
  • 140-140: The parameter value in the test function TestParallelAnteHandler_ClobAndOther has been changed from 100_000 to 110_000. Could you please clarify the rationale behind this change? It's important to understand how this adjustment affects the test's sensitivity to transaction processing limits or fees and whether it aligns with the objectives of enhancing subaccount management by validating updates against isolated market constraints.

@@ -511,6 +517,7 @@ func checkPositionUpdatable(

// internalCanUpdateSubaccounts will validate all `updates` to the relevant subaccounts.
// The `updates` do not have to contain `Subaccounts` with unique `SubaccountIds`.
// The `updates` do not have to contain `Subaccounts` with unique `SubaccountIds`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: repeated line

Copy link
Contributor

@shrenujb shrenujb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 124bc3f and a0ed3da.
Files selected for processing (2)
  • protocol/x/subaccounts/keeper/isolated_subaccount.go (1 hunks)
  • protocol/x/subaccounts/keeper/subaccount.go (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • protocol/x/subaccounts/keeper/isolated_subaccount.go
  • protocol/x/subaccounts/keeper/subaccount.go

@vincentwschau vincentwschau merged commit 6bcd294 into main Mar 13, 2024
18 checks passed
@vincentwschau vincentwschau deleted the vincentc/isolated-subaccounts-check branch March 13, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants